<!DOCTYPE html>
<html lang="zh_CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>添加文章</title>
  <!-- 引入图标 -->
  <link rel="shortcut icon" href="/favicon.ico" />
  <!-- 引入layui样式 -->
  <link rel="stylesheet" href="/layui/css/layui.css">
  <!-- 引入bootstrap样式 -->
  <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css" rel="stylesheet">
  <!-- 引入文章页样式 -->
  <link rel="stylesheet" href="/css/addarticle.css">
</head>
<body>
  <div class="container-fluid bg-secondary header">
    <div class="row">
      <div class="col-md-4">
        <div class="logo">
          <a href="{{url('/admin/article/index')}}">
            <img src="/logo.png" alt="">
          </a>
          <h2 class="float-right">后台控制台</h2>
        </div>
      </div>
      <div class="col-md-8">
        <div class="user pr-5">
          <a href="{{url('/admin/user/profile/'.Auth::id())}}">个人中心</a> ｜ <a href="{{url('/')}}">首页</a>
        </div>
      </div>
    </div>
  </div>
  <div class="article container my-3">
    <form action="/admin/article/add" method="POST" enctype="multipart/form-data">
      <p>文章标题</p>
      <input type="text" name="title" autocomplete="off" id="title" placeholder="标题">
      <p>关键词</p>
      <input type="text" name="keyword" autocomplete="off" id="keyword" placeholder="关键词">
      <i><span class="badge badge-info">i</span>关键词之间用,逗号分割</i>
      <p>文章封面</p>
      <input type="file" name="pic" id="file"  placeholder="封面">
      @csrf
      <p>内容</p>
       <!-- 加载编辑器的容器 -->
      <script  id="container" name="content" type="text/plain">
        
      </script>

      <!-- 配置文件 -->
      <script type="text/javascript" src="/plugins/ueditor/ueditor.config.js"></script>
      <!-- 编辑器源码文件 -->
      <script type="text/javascript" src="/plugins//ueditor/ueditor.all.min.js"></script>
      <!-- 实例化编辑器 -->
      <script type="text/javascript">
          var ue = UE.getEditor('container');
      </script>
      <button type="submit" class="btn btn-success btn-lg d-block dosub">发布文章</button>
    </form>
  </div>
  <div class="footer container text-center py-3">
    版权所有&copy;生活博客
  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  <script src="/layui/layui.js"></script>
  <script>
    $('.dosub').click(function(event) {
      if($('#title').val() == '' || $('#keyword').val() == '' || $('#file').val() == '') {
        event.preventDefault();
      }
    })
  </script>
</body>
</html>